package com.thinkfit.jy.activity;

import android.view.View;
import android.widget.TextView;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import com.thinkfit.jy.R;
import com.thinkfit.jy.fragment.BluetoothFragment;
import com.thinkfit.jy.fragment.TNJBluetoothSettingFragment;
import com.thinkfit.jy.fragment.WifiConnectFragment;
import com.thinkfit.jy.serialport.SerialPortManager;

public class SimpleBluetoothActivity extends MainActivity implements View.OnClickListener {

    View vBlack;
    TextView tvTitle;
    protected int getLayoutId() {
        return R.layout.item_simple_wifi;
    }

    @Override
    public void init() {
        vBlack = findViewById(R.id.v_black);
        tvTitle = findViewById(R.id.tv_title);
        vBlack.setOnClickListener(this);
        tvTitle.setText(getString(R.string.app_bluetooth));
        toFragment(new TNJBluetoothSettingFragment());
    }

    public void toFragment(Fragment fragment) {
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
//        ft.setCustomAnimations(R.anim.slide_fragment_in,R.anim.slide_fragment_out);
        ft.replace(R.id.fl_wifi, fragment);
        ft.commit();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.v_black:
                finish();
//                goneLayout();
                break;
        }
    }

    @Override
    public void resetInfo(SerialPortManager.CurrentInfo info) {

    }
}
